var p1 = new Promise((resolve, reject) => {
    setTimeout(function() {
        resolve("success.");
    }, 1000);
});

var p2 = new Promise((resolve, reject) => {
    resolve(p1);
});

console.log(p2.then(value => {
    console.log(value);
}));